Xbasic
SIGN Function
Syntax
Integer_Result as N = SIGN(N number)
Arguments
- number
Numeric
Description
Returns 1 if a number is positive, 0 if it is zero and -1 if it is negative.
Discussion
SIGN() returns an Integer_Result representing the sign of a Number. SIGN() returns 1 for positive numbers, 0 for zero, and -1 for negative numbers.
Example
sign(24) -> 1 sign(-4) -> -1
See Also